package it.uniroma2.dtk.drp;

public class ComparableResult implements Comparable {
		
		public String good = null;
		public double similarity = 0;
	
		public ComparableResult(String good, double similarity) {
			super();
			this.good = good;
			this.similarity = similarity;
		}
		
	    public int compareTo(Object o) {
	        // If this < o, return a negative value
	        // If this = o, return 0
	        // If this > o, return a positive value
	    	
	    	return (int) (this.similarity - ((ComparableResult)o).similarity < 0? 1 : -1);
	    }
	}

